﻿
@{
    ViewBag.Title = "发票查询";
    Layout = "~/Views/Shared/_Index.cshtml";
}

<div class="panel panel-default">
    <table class="form">
        <tr>
            <th class="formTitle"><span class="required">*</span>查询时间范围：</th>
            <td class="formValue">
                <input id="kssj" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" value="@DateTime.Now.AddDays(-3).ToString("yyyy-MM-dd")" />
            </td>
            <th style="text-align:center;width:50px;">至</th>
            <td class="formValue">
                <input id="jssj" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" value="@DateTime.Now.AddDays(1).ToString("yyyy-MM-dd")" />
            </td>
            <td class="formTitle">
                <input type="button" class="btn btn-default btn-md" id="btn_search" value="查询" />
            </td>
        </tr>
    </table>
</div>

<div class="gridPanel">
    <table id="gridList"></table>
</div>
<script>
    $(function () {
        gridList();
        $("#btn_search").trigger("click");
    });

    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            height: $(window).height() - 100,
            colModel: [
                { label: '就诊类型', name: 'jzlx', algin: 'left', width: 80 },
                { label: '就诊号', name: 'jzh', algin: 'left' },
                { label: '发票号', name: 'fph', algin: 'left', width: 80 },
                { label: '患者姓名', name: 'xm', algin: 'left' },
                { label: '就诊卡号', name: 'kh', algin: 'left' },
                { label: '科室名称', name: 'ks', algin: 'left' },
                { label: '总金额', name: 'zje', algin: 'right', width: 80 },
                {
                    label: '收费日期', name: 'sfrq', align: 'center', width: 120, 
                    formatter: "date", formatoptions: { srcformat: 'Y-m-d H:i', newformat: 'Y-m-d H:i' }
                }
            ]
        });
        $("#btn_search").click(function () {
            $gridList.jqGrid('setGridParam', {
                postData: {
                    kssj: $("#kssj").val(),
                    jssj: $("#jssj").val()
                }, url: "/SystemManage/FinancialInvoice/InvoiceQueryList"
            }).trigger('reloadGrid');
        })
    }
</script>

